﻿package xde2d.utils
{

    public class NumberUtil extends Object
    {
        public static function rnd0_1() : Number
        {
            return Math.random();
        }

        public static function rndMinus1_1() : Number
        {
            return Math.random() - Math.random();
        }

        public static function rndMinMax(param1:Number, param2:Number) : Number
        {
            return param1 + Math.random() * (param2 - param1);
        }

        public static function rndMinMaxInt(param1:int, param2:int) : int
        {
            return Math.round(rndMinMax(param1, param2));
        }

        public static function sin0_1(param1:Number) : Number
        {
            return 0.5 + Math.sin(param1) * 0.5;
        }

        public static function toLeftHandle(value:Number) : Number
        {
            return -value;
        }

        public static function mylerp(param1:Number, param2:Number, param3:Number) : Number
        {
            return param1 + param3 * (param2 - param1);
        }

    }
}
